The present invention relates to distributed and concurrent software systems that use asynchronous messaging and, more particularly, to methods and apparatus for defining and handling message delivery outcomes, e.g., successes and/or failures, on a per-message basis.
Distributed and concurrent software systems employ different forms of electronic communication. Messaging is one such communication model. With messaging, the system components communicate with each other by sending messages. A message conveys some application-specific data.
Messaging is inherently asynchronous in that a system component sends a message at one point in time and continues to compute independent of the message delivery and any recipients of the message. The message sender may receive a reply to the message at a later point in time. The sender and the recipients of the message are time-independent, i.e., they need not be available on the network at the same time.
Many distributed and concurrent software systems depend on asynchronous messaging, and use message middleware for this purpose. Message middleware refers to one or more software programs for effecting messaging operations between components of a software system. With message middleware, a message typically is sent to some form of destination, for example, a message queue, from which other clients of the message middleware, e.g., final message recipients, can then read the message. Thus, the sender and the recipients of a message are not necessarily aware of each other""s existence.
The failure and respective success of each message delivery is important, possibly even critical, to the sender of the message. The application-specific criteria by which message delivery failure is determined may, in general, differ from sender to sender and message to message. However, specifying these criteria, evaluating the message delivery according to the criteria, and reacting to the outcome of the evaluation is difficult to do and not readily supported by existing message middleware.
Existing message middleware, for example, MQSeries (a trademark of IBM Corporation) or implementations of the Java Message Service JMS (a trademark of Sun Microsystems, Inc.), only support a very limited notion of message delivery failure, and do not differentiate between different failure notions that the sender of a message could otherwise define on a per-message basis. The sender of a message only specifies the destination of the message and may declare the message delivery to be reliable. The message middleware then guarantees the delivery of the message to the destination even in the presence of failures such as system crashes. Existing message middleware does not support the definition of application-specific criteria upon which the failure and respective success of a message delivery can be determined.
The present invention provides methods and apparatus for defining and handling message delivery outcomes on a per-message basis. It is to be appreciated that the outcome may be considered either xe2x80x9csuccessxe2x80x9d or xe2x80x9cfailure.xe2x80x9d
In one aspect of the invention, a computer-based method for use in an asynchronous messaging system comprises the steps of: (i) defining at least one message delivery outcome condition for at least one message to be sent in the system and associating the message delivery outcome condition with the message to be sent in the system; (ii) sending the message with the associated message delivery outcome condition in the system; and (iii) monitoring delivery of the sent message and evaluating the delivery outcome of the message with respect to the associated message delivery outcome condition such that a sender of the message may be notified as to the outcome of the delivery of the message to final recipients.
In another aspect of the present invention, an application programming interface is provided to be used by the sender of a message to perform the steps of: (i) specifying message delivery outcome conditions on a per-message basis; (ii) associating messages and (object representations of) message outcome conditions; (iii) sending out messages with these outcome conditions; (iv) querying about the status of message deliveries with respect to their outcome conditions; (v) permitting the modification or replacement of the outcome conditions specified for a message; and (vi) designating an object to receive evaluation outcome notifications.
In yet another aspect of the present invention, computer-based apparatus is provided for performing one or more of the following operations: (i) representing message outcome conditions as persistent objects; (ii) observing message delivery; (iii) evaluating message outcome conditions; (iv) answering queries about the status of message deliveries with respect to their outcome conditions; and (v) notifying the message sender or an object that the sender designates about the evaluation outcome for each message sent. The apparatus may be implemented using existing message middleware adapted to implement the inventive teachings provided herein.
These and other objects, features and advantages of the present invention will become apparent from the following detailed description of illustrative embodiments thereof, which is to be read in connection with the accompanying drawings.